﻿using System;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            //日期时间
            var time = DateTime.Now;
            Console.WriteLine("现在时间："+time);
            //天数加减
            var aDate = time.AddDays(-1);
            Console.WriteLine(aDate);
            Console.WriteLine(aDate.Day);
            Console.WriteLine();

            //字符串
            string a = "  花有重开日，人无再少年   ";
            Console.WriteLine(a.Length);
            //查找字符串
            Console.WriteLine(a.IndexOf("人"));
            Console.WriteLine(a.LastIndexOf("年"));
            //删除字符串
            Console.WriteLine(a.Remove(0,8));
            //去首尾空格
            Console.WriteLine(a.TrimStart());
            Console.WriteLine(a.TrimEnd());
            //填首尾空格
            Console.WriteLine(a.PadLeft(100));
            Console.WriteLine(a.PadRight(100));
            //替换字符串内容
            Console.WriteLine(a.Replace("花","草"));
            //指定位置截取字符串
            Console.WriteLine(a.Substring(0,5));
            //字符串插入
            Console.WriteLine(a.Insert(0,"你"));

        }
    }
}
